package com.suntop.carousel.qlmediaplay.media;

import android.content.res.AssetFileDescriptor;
import android.view.View;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.DecodeFormat;
import com.bumptech.glide.request.RequestOptions;
import com.bumptech.glide.request.target.Target;
import com.suntop.carousel.qlmediaplay.field.Field_Scale;
import com.suntop.carousel.qlmediaplay.video.player.ICoverView;
import com.suntop.carousel.qlmediaplay.video.player.IMediaPlayerControl;
import com.suntop.carousel.qlmediaplay.video.player.IVideoPlayer;

import java.io.FileDescriptor;

import androidx.annotation.IntRange;

/**
 * 多媒体播放器 需实现这个类
 */
public interface IMediaPlayer {
    /**
     * 设置标记位
     *
     * @param iVideoPlayer
     */
    IMediaPlayer init(IVideoPlayer iVideoPlayer);


    IMediaPlayer initFarm(DecodeFormat decodeFormat);

    IMediaPlayer addEventListener(IMediaPlayEventListener listener);

    IMediaPlayEventListener getEventListener();

    IMediaPlayer setDate(String playUrl);
    IMediaPlayer setDate(AssetFileDescriptor fileDescriptor);
    public String getPlayUrl();

    IMediaPlayer setScaleType(@IntRange(from = Field_Scale.Scale_Default
            , to = Field_Scale.Scale_Crop) int scaleType);

    int getScale();

    IMediaPlayer setDelayTime(long time);

    long getDelayTime();

    IMediaPlayer autoCache(boolean auto);

    IMediaPlayer addIConView(ICoverView iCoverView, boolean isNeedBitmap);

    IMediaPlayer addController(IMediaPlayerControl control);

    IMediaPlayer setReBack(boolean isReBack);

    boolean isPlaying();

    void build(boolean isPlay);

    void startPlay();

    void pausePlay();

    void stopPlay();

    void pauseTo();

    void reSetCupPicture();

    void releasePlay();

    void releaseNoClear();

    IMediaPlayer setMediaType(int type);

    View getQLView();

     IMediaPlayer setVoice(float left, float right);

     IMediaPlayer setLoop(boolean isLoop);
}
